export function getPublicWorks(pageId, limit, orderBy, order) {
  const endpoint = APP_CONFIG.endPoint;
  return Hfetch.get(`${endpoint}/asset-store/assets`, {
    pageId, limit, orderBy, order,
  });
}

export function getWorkById(id) {
  const endpoint = APP_CONFIG.endPoint;
  return Hfetch.get(`${endpoint}/asset-store/assets/${id}`);
}

export function getMyWorkById(id, token) {
  const endpoint = APP_CONFIG.endPoint;
  return Hfetch.get(`${endpoint}/asset-store/me/assets/${id}`, {}, {
    headers: {
      Authorization: token,
    },
  });
}

export function getCategoryWorks(categoryId, pageId, limit, orderBy, order) {
  const endpoint = APP_CONFIG.endPoint;
  return Hfetch.get(`${endpoint}/asset-store/assets/categories/${categoryId}`, {
    pageId, limit, orderBy, order,
  });
}

export function getUserWorks(userId, pageId, limit) {
  const endpoint = APP_CONFIG.endPoint;
  return Hfetch.get(`${endpoint}/asset-store/assets/users/${userId}`, {
    pageId, limit,
  });
}
